package com.gosophia.conference.action.confPrepare;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.gosophia.commons.exception.BusinessException;
import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.conferenceManagement.common.dto.DocumentDTO;
import com.gosophia.conferenceManagement.confPreparation.ws.ConfPreparationWebService;
import com.gosophia.oa.action.JudgeCurrentUndertaker;
import com.opensymphony.xwork2.ActionSupport;
/**
 * 获取会议议程Action
 * @author wangxinbing
 * @since  2011-3-26
 *  Copyright (c) 2010 Gosophia corporation All Rights Reserved
 */
@Component("GetConferenceAgendaAction")
@Scope("prototype")
public class GetConferenceAgendaAction extends BaseSupportAction {
	@Autowired
	private ConfPreparationWebService confPreparationWebService;
	@Autowired
	private JudgeCurrentUndertaker judgeCurrentUndertaker;
	
	private Long jobId;
	
	private DocumentDTO agenda;
	
    private String onlinePath;
	
	private String onlineVersion;
	
	private String onlineIsEdit = null;
	public Long getJobId() {
		return jobId;
	}

	public void setJobId(Long jobId) {
		this.jobId = jobId;
	}

	public DocumentDTO getAgenda() {
		return agenda;
	}

	public void setAgenda(DocumentDTO agenda) {
		this.agenda = agenda;
	}

	@Override
	public String _execute() throws Exception {
		//判断是否匹配,如果不匹配转到异常页面
        judgeCurrentUndertaker.judgeOperationAuthority(jobId);
		agenda =  confPreparationWebService.findAgendaByJobId(jobId);
		onlinePath = agenda.getDocumentPath();
		onlineVersion = agenda.getDocumentVersion();
		return SUCCESS;
	}

	public String getOnlinePath() {
		return onlinePath;
	}

	public void setOnlinePath(String onlinePath) {
		this.onlinePath = onlinePath;
	}

	public String getOnlineVersion() {
		return onlineVersion;
	}

	public void setOnlineVersion(String onlineVersion) {
		this.onlineVersion = onlineVersion;
	}

	public String getOnlineIsEdit() {
		return onlineIsEdit;
	}

	public void setOnlineIsEdit(String onlineIsEdit) {
		this.onlineIsEdit = onlineIsEdit;
	}
}
